The interface between T3 and the local operating system is the define-foreign special form:
(define-foreign T-name
(foreign-name parameterstex2html_wrap_inline$^+$ )
return-type)
undefined
syntax
define-foreign defines a foreign procedure, i.e. a T procedure which will call a procedure defined by the operating system or in another language.
formula vobeyspaces : |
parameter-type → { in | out | in/out | var | ignore }
foreign-type → { rep/integer | rep/integer-8-s | rep/integer-8-u | rep/integer-16-s | rep/integer-16-u | rep/value | rep/extend | rep/extend-pointer | rep/string | rep/string-pointer }
parameter-name → symbol used for identification
return-type → Aegis: { foreign-type | ignore | rep/address } Unix: { foreign-type | ignore }
For example, on the Apollo a procedure to do block reads from a stream would be defined as follows:
formula vobeyspaces : |
The following code will use aegis-read to read in a string from standard input:
formula vobeyspaces : |
On a Unix machine a similar procedure would be defined as,
formula vobeyspaces : |
To read a string from standard input on Unix the T code would look something like:
formula vobeyspaces : |